package com.compiler.lexico.action;

import java.io.IOException;
import java.io.RandomAccessFile;
import com.compiler.lexico.token.SymbolTable;
import com.compiler.lexico.token.Token;
import com.compiler.syntactic.Parser;

public class InsertString extends AbstractAction {
	private final static String TYPE="Cadena de caracteres";
	
	public InsertString(Token token, SymbolTable symbolTable) {
		super(token,symbolTable);
	}

	@Override
	public void exec(RandomAccessFile raf) throws IOException {
		this.symbolTable.addToken(new Token(token.getData(),TYPE,token.getLine(),Parser.CADENA));
		this.token.clean();
	}

	@Override
	public String toString() {
		return "Insert";
	}

}
